package com.装饰器模式;

/**
 * @author Fang Ruichuan
 * @date 2022-09-29 10:02
 */

public class Client {
    public static void main(String[] args) {
        System.out.println("一只善良小狗子散步中。。。。。");
        Animal animal = new Dog();
        System.out.println("一只凶猛大狗出现，前来欺负善良小狗。。。。。");
        System.out.println("赶紧为善良小狗装上保护装备，反击的时候到了。。。。。");
        animal = new AnimalProtectionEquipment(animal);
        animal.bite();
        System.out.println("糟糕了，有点过了，跑路吧，小狗子移动太慢了，装上加速装备。。。。。");
        animal = new AnimalAcceleratorEquipment(animal);
        animal.move();
    }
}
